package us.versus.them.stickler.models;

import us.versus.them.stickler.App;
import us.versus.them.stickler.Vertlet;
import us.versus.them.stickler.Point;

class Original {
	public function new() {
	}

	public function join( app : App, offset : Point, scale : Float ) : Vertlet {
		var head           = Vertlet.gnu( 415.40612, 68.16921, 0, offset, scale );
		var neck           = Vertlet.gnu( 415.40612, 161.9018, 0, offset, scale );
		var lt_neck        = Vertlet.gnu( 400.40612, 191.9018, 0, offset, scale );
		var rt_neck        = Vertlet.gnu( 430.40612, 191.9018, 0, offset, scale );
		var lt_shoulder    = Vertlet.gnu( 311.02202, 200.2470, 0, offset, scale );
		var lt_elbow       = Vertlet.gnu( 264.15569, 313.1523, 0, offset, scale );
		var lt_wrist       = Vertlet.gnu( 238.59224, 430.3181, 0, offset, scale );
		var lt_finger_tips = Vertlet.gnu( 236.46195, 489.9662, 0, offset, scale );
		var rt_shoulder    = Vertlet.gnu( 519.79022, 200.2470, 0, offset, scale );
		var rt_elbow       = Vertlet.gnu( 566.65655, 313.1523, 0, offset, scale );
		var rt_wrist       = Vertlet.gnu( 592.22000, 430.3181, 0, offset, scale );
		var rt_finger_tips = Vertlet.gnu( 594.35029, 489.9662, 0, offset, scale );
		var rib            = Vertlet.gnu( 415.40612, 300.9018, 0, offset, scale );
		var back           = Vertlet.gnu( 415.40612, 451.9018, 0, offset, scale );
		var lt_hip         = Vertlet.gnu( 330.02202, 510.2470, 0, offset, scale );
		var lt_knee        = Vertlet.gnu( 264.15569, 613.1523, 0, offset, scale );
		var lt_ankle       = Vertlet.gnu( 238.59224, 730.3181, 0, offset, scale );
		var lt_tip_toe     = Vertlet.gnu( 198.46195, 730.9662, 0, offset, scale );
		//var lt_tip_toe     = Vertlet.gnu( 236.46195, 789.9662, 0, offset, scale );
		var rt_hip         = Vertlet.gnu( 500.79022, 510.2470, 0, offset, scale );
		var rt_knee        = Vertlet.gnu( 566.65655, 613.1523, 0, offset, scale );

		var rt_ankle       = Vertlet.gnu( 592.22000, 730.3181, 0, offset, scale );
		var rt_tip_toe     = Vertlet.gnu( 632.35029, 730.9662, 0, offset, scale );
		//var rt_tip_toe     = Vertlet.gnu( 594.35029, 789.9662, 0, offset, scale );

		app.add( head           );
		app.add( neck           );
		app.add( rt_neck        );
		app.add( lt_neck        );
		app.add( lt_shoulder    );
		app.add( lt_elbow       );
		app.add( lt_wrist       );
		app.add( lt_finger_tips );
		app.add( rt_shoulder    );
		app.add( rt_elbow       );
		app.add( rt_wrist       );
		app.add( rt_finger_tips );
		app.add( rib            );
		app.add( back           );
		app.add( lt_hip         );
		app.add( lt_knee        );
		app.add( lt_ankle       );
		app.add( lt_tip_toe     );
		app.add( rt_hip         );
		app.add( rt_knee        );
		app.add( rt_ankle       );
		app.add( rt_tip_toe     );

		app.link( head, neck );

		// try to make the neck more stable!
		app.link( neck, lt_neck );
		app.link( neck, rt_neck );
		app.link( head, lt_neck );
		app.link( head, rt_neck );
		app.link( lt_neck, rt_neck );
		app.link( lt_neck, lt_shoulder );
		app.link( rt_neck, rt_shoulder );

		app.link( neck, lt_shoulder );
		app.link( lt_shoulder, lt_elbow );
		app.link( lt_elbow, lt_wrist );
		app.link( lt_wrist, lt_finger_tips  );

		app.link( lt_shoulder, rt_shoulder );

		app.link( neck, rt_shoulder );
		app.link( rt_shoulder, rt_elbow );
		app.link( rt_elbow, rt_wrist );
		app.link( rt_wrist, rt_finger_tips );

		app.link( neck, rib );
		app.link( rib, lt_shoulder );
		app.link( rib, rt_shoulder );
		app.link( rib, back );

		app.link( back     , lt_hip     );
		app.link( lt_hip   , lt_knee    );
		app.link( lt_knee  , lt_ankle   );
		app.link( lt_ankle , lt_tip_toe );

		app.link( lt_hip, rt_hip );

		app.link( back     , rt_hip     );
		app.link( rt_hip   , rt_knee    );
		app.link( rt_knee  , rt_ankle   );
		app.link( rt_ankle , rt_tip_toe );

		// make torso more substantial
		app.link( back, rt_shoulder );
		app.link( back, lt_shoulder );

		// make the pelvice more substantial
		app.link( rib, rt_hip );
		app.link( rib, lt_hip );

		// beef up the legs
		app.link( back, rt_knee );
		app.link( back, lt_knee );
		app.link( rt_hip, rt_ankle );
		app.link( lt_hip, lt_ankle );
		app.link( rt_knee, rt_tip_toe );
		app.link( lt_knee, lt_tip_toe );

		// arms
		app.link( lt_neck, lt_elbow );
		app.link( lt_elbow, lt_finger_tips );
		app.link( rt_neck, rt_elbow );
		app.link( rt_elbow, rt_finger_tips );

		return head;
	}
}
